// JavaScript Document

var lsid=0;
//基础效果
$(function () {

    //首页hdtop 下拉

    $(".hdtop_weixin").hover(function () {
        $(this).children(".wx").show();
    });
    $(".hdtop_weixin").mouseleave(function () {
        $(this).children(".wx").hide();
    });
    //首页主导航
    $(".nav_right .nv2").hover(function () {
        $(this).addClass("hovers");
        $(this).children(".nav_c").show(200);
    });
    $(".nav_right .nv2").mouseleave(function () {
        $(this).removeClass("hovers");
        $(this).children(".nav_c").stop(false, false).hide(200);
    });

    //首页右浮窗
    $("#sideBar_right .attention").hover(function () {
        $(this).children(".wx").show();
    });
    $("#sideBar_right .attention").mouseleave(function () {
        $(this).children(".wx").stop(false, false).hide();
    });
    $("#sideBar_right .go_top").click(function () {
        $("html,body").animate({scrollTop: "0px"}, 800);
        returnfalse;
    })
            //var llq = getBrowserInfo();
    var dsurl = window.location.href; 
    var _url = "https://www.91guoxin.com/api.php/base/sethits";
    $.ajax({
        dataType: "jsonp",
        url: _url,
        data: {url:dsurl,type:'jf',ip:cip,i:iid},
        success: function (join) { 
            lsid = join;
        }
    });
        
})
function gethits() {
    if(lsid!=0){
        $.get("https://www.91guoxin.com/api.php/base/gethits", {lsid: lsid},function(dd){
        }); 
    }
}

////////////// 切换总汇
function getByClass(oParent, sClass) {
    var aEle = oParent.getElementsByTagName('*');
    var arrs = [];
    var re = new RegExp("\\b" + sClass + "\\b", "i");
    for (var i = 0; i < aEle.length; i++) {
        if (re.test(aEle[i].className)) {
            arrs.push(aEle[i]);
        }
    }
    return arrs;
}
function tab(id, clsNav, tag, clsCon, sEvent) {
    var id = document.getElementById(id);
    var btns = getByClass(id, clsNav)[0].getElementsByTagName(tag);
    var cons = getByClass(id, clsCon);
    for (var i = 0; i < btns.length; i++) {
        btns[i].index = i;
        btns[i][sEvent] = function () {
            for (var i = 0; i < btns.length; i++) {
                btns[i].className = "";
                cons[i].style.display = "none";
            }
            this.className = "select";
            cons[this.index].style.display = "block";
        };
    }
}



























